package mysql

import "gorm.io/gorm"

// 报修订单表
type Order struct {
	gorm.Model
	UserId  int    `gorm:"column:user_id;type:int;not null;comment:用户ID"`
	Img     string `gorm:"column:img;type:varchar(100);not null;comment:现场照片"`
	Types   int    `gorm:"column:types;type:int;not null;comment:报修分类1.电,2.水,3.桌椅门窗,4.其他"`
	Comment string `gorm:"column:comment;type:varchar(300);not null;comment:情况描述"`
	Content string `gorm:"column:content;type:varchar(300);not null;comment:联系信息"`
	Status  int    `gorm:"column:status;type:int;not null;comment:状态"`
}

// 添加报修订单
func (o *Order) CreateOrder() (db *gorm.DB) {
	db = DB
	db = db.Create(&o)
	return
}
